<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>收率预测 - 异烟酸生产收率预测系统</title>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css">
    <link rel="stylesheet" href="styles/unified.css">
    <link rel="stylesheet" href="styles/components.css">
</head>
<body>
    <div class="app-container">
        <!-- 侧边栏 -->
        <div class="sidebar">
            <button class="sidebar-toggle">
                <i class="fas fa-chevron-left"></i>
            </button>
            <div class="logo">
                <img src="img/logo-icon.svg" alt="异烟酸生产收率预测系统Logo">
                <span class="logo-text">异烟酸生产收率预测</span>
            </div>
            <nav class="nav-menu">
                <a href="index.html" class="nav-item" data-title="首页">
                    <i class="fas fa-home nav-icon"></i>
                    <span class="nav-text">首页</span>
                </a>
                <a href="qd-display.html" class="nav-item" data-title="主控面板">
                    <i class="fas fa-tachometer-alt nav-icon"></i>
                    <span class="nav-text">主控面板</span>
                </a>
                <a href="model-value.html" class="nav-item" data-title="模型应用价值">
                    <i class="fas fa-chart-line nav-icon"></i>
                    <span class="nav-text">模型应用价值</span>
                </a>
                <a href="system-architecture.html" class="nav-item" data-title="系统架构设计">
                    <i class="fas fa-project-diagram nav-icon"></i>
                    <span class="nav-text">系统架构设计</span>
                </a>
                <a href="data-flow.html" class="nav-item" data-title="数据流设计">
                    <i class="fas fa-database nav-icon"></i>
                    <span class="nav-text">数据流设计</span>
                </a>
                <a href="model-deployment.html" class="nav-item" data-title="模型部署与应用">
                    <i class="fas fa-cogs nav-icon"></i>
                    <span class="nav-text">模型部署与应用</span>
                </a>
                <a href="ui-design.html" class="nav-item" data-title="用户界面设计">
                    <i class="fas fa-desktop nav-icon"></i>
                    <span class="nav-text">用户界面设计</span>
                </a>
                <a href="yield-prediction.html" class="nav-item" data-title="收率预测">
                    <i class="fas fa-flask nav-icon"></i>
                    <span class="nav-text">收率预测</span>
                </a>
                <a href="parameter-monitoring.html" class="nav-item" data-title="关键参数监控">
                    <i class="fas fa-eye nav-icon"></i>
                    <span class="nav-text">关键参数监控</span>
                </a>
                <a href="online-analysis.html" class="nav-item" data-title="在线分析">
                    <i class="fas fa-chart-bar nav-icon"></i>
                    <span class="nav-text">在线分析</span>
                </a>
                <a href="model-performance.html" class="nav-item" data-title="模型性能">
                    <i class="fas fa-chart-pie nav-icon"></i>
                    <span class="nav-text">模型性能</span>
                </a>
                <a href="model-details.html" class="nav-item" data-title="模型详情">
                    <i class="fas fa-info-circle nav-icon"></i>
                    <span class="nav-text">模型详情</span>
                </a>
                <a href="model-update.html" class="nav-item" data-title="模型更新">
                    <i class="fas fa-sync-alt nav-icon"></i>
                    <span class="nav-text">模型更新</span>
                </a>
                <a href="model-config.html" class="nav-item" data-title="系统配置">
                    <i class="fas fa-sliders-h nav-icon"></i>
                    <span class="nav-text">系统配置</span>
                </a>
                <a href="documentation.html" class="nav-item" data-title="技术文档">
                    <i class="fas fa-book nav-icon"></i>
                    <span class="nav-text">技术文档</span>
                </a>
            </nav>
            <div class="sidebar-footer">
                <div class="user-info">
                    <img class="user-avatar" src="https://cdn-icons-png.flaticon.com/512/1077/1077114.png" alt="User">
                    <span class="user-name">管理员</span>
                </div>
                <a href="#" class="logout-btn">
                    <i class="fas fa-sign-out-alt"></i>
                </a>
            </div>
        </div>

        <!-- 移动端菜单遮罩层 -->
        <div class="sidebar-overlay"></div>
        
        <!-- 移动端菜单按钮 -->
        <button class="mobile-toggle">
            <i class="fas fa-bars"></i>
        </button>

        <!-- 主内容区 -->
        <div class="main-content">
            <!-- 顶部导航栏 -->
            <header class="top-bar">
                <div class="page-title">
                    <h1>收率预测</h1>
                    <p>异烟酸生产收率实时预测与参数优化</p>
                </div>
                <div class="top-bar-actions">
                    <div class="search-bar">
                        <i class="fas fa-search"></i>
                        <input type="text" placeholder="搜索...">
                    </div>
                    <div class="notification">
                        <i class="far fa-bell"></i>
                        <span class="badge">3</span>
                    </div>
                    <div class="setting">
                        <i class="fas fa-cog"></i>
                    </div>
                </div>
            </header>

            <!-- 内容区域 -->
            <div class="content-wrapper">
                <!-- 顶部导航链接 -->
                <div class="navigation-links">
                    <a href="yield-prediction.html" class="nav-link active">收率预测</a>
                    <a href="parameter-monitoring.html" class="nav-link">关键参数监控</a>
                    <a href="parameter-optimization.html" class="nav-link">参数优化建议</a>
                    <a href="yield-forecast.html" class="nav-link">预警信息</a>
                </div>

                <!-- 页面内容 -->
                <div class="page-content">
                    <!-- 当前批次信息 -->
                    <div class="section-title">当前批次信息</div>
                    
                    <div class="content-card">
                        <div class="content-card-title">
                            <i class="fas fa-info-circle"></i>
                            批次基本信息
                        </div>
                        
                        <div class="model-metrics">
                            <div class="metric-item">
                                <div class="metric-icon"><i class="fas fa-hashtag"></i></div>
                                <div class="metric-info">
                                    <div class="metric-name">批次编号</div>
                                    <div class="metric-value">B2023112501</div>
                                </div>
                            </div>
                            <div class="metric-item">
                                <div class="metric-icon"><i class="fas fa-calendar-alt"></i></div>
                                <div class="metric-info">
                                    <div class="metric-name">开始时间</div>
                                    <div class="metric-value">2023-11-25 08:30</div>
                                </div>
                            </div>
                            <div class="metric-item">
                                <div class="metric-icon"><i class="fas fa-hourglass-half"></i></div>
                                <div class="metric-info">
                                    <div class="metric-name">已运行时间</div>
                                    <div class="metric-value">18小时26分钟</div>
                                </div>
                            </div>
                            <div class="metric-item">
                                <div class="metric-icon"><i class="fas fa-user"></i></div>
                                <div class="metric-info">
                                    <div class="metric-name">负责人</div>
                                    <div class="metric-value">张工程师</div>
                                </div>
                            </div>
                        </div>
                    </div>
                    
                    <!-- 收率预测结果 -->
                    <div class="section-title">收率预测结果</div>
                    
                    <div class="content-card">
                        <div class="content-card-title">
                            <i class="fas fa-chart-pie"></i>
                            实时收率预测
                        </div>
                        
                        <div class="yield-prediction">
                            <div class="yield-gauge">
                                <div class="yield-value">91.8%</div>
                                <div class="yield-label">预测收率</div>
                                <div class="yield-range">
                                    <span class="range-min">±0.6%</span>
                                    <span class="range-max">置信区间</span>
                                </div>
                            </div>
                            
                            <div class="yield-details">
                                <div class="yield-detail-item">
                                    <div class="detail-label">历史平均收率</div>
                                    <div class="detail-value">87.5%</div>
                                    <div class="detail-trend trend-up">
                                        <i class="fas fa-arrow-up"></i> +4.3%
                                    </div>
                                </div>
                                
                                <div class="yield-detail-item">
                                    <div class="detail-label">理论最大收率</div>
                                    <div class="detail-value">94.2%</div>
                                    <div class="detail-trend">
                                        <i class="fas fa-minus"></i> -2.4%
                                    </div>
                                </div>
                                
                                <div class="yield-detail-item">
                                    <div class="detail-label">上批次收率</div>
                                    <div class="detail-value">89.6%</div>
                                    <div class="detail-trend trend-up">
                                        <i class="fas fa-arrow-up"></i> +2.2%
                                    </div>
                                </div>
                                
                                <div class="yield-detail-item">
                                    <div class="detail-label">预测准确度</div>
                                    <div class="detail-value">93.8%</div>
                                    <div class="detail-info">
                                        <i class="fas fa-info-circle"></i>
                                    </div>
                                </div>
                            </div>
                        </div>
                        
                        <div class="yield-trend-chart">
                            <img src="https://via.placeholder.com/1000x300?text=收率预测趋势图" alt="收率预测趋势图" style="width: 100%; height: auto; border-radius: var(--radius); margin-top: 20px;">
                        </div>
                    </div>
                    
                    <!-- 关键影响因素 -->
                    <div class="section-title">关键影响因素</div>
                    
                    <div class="content-card">
                        <div class="content-card-title">
                            <i class="fas fa-puzzle-piece"></i>
                            收率影响因素分析
                        </div>
                        
                        <div class="feature-importance">
                            <div class="feature-item">
                                <div class="feature-name">反应温度稳定性</div>
                                <div class="feature-bar-container">
                                    <div class="feature-bar" style="width: 92%"></div>
                                </div>
                                <div class="feature-value">28.5%</div>
                            </div>
                            <div class="feature-item">
                                <div class="feature-name">原料纯度指标</div>
                                <div class="feature-bar-container">
                                    <div class="feature-bar" style="width: 78%"></div>
                                </div>
                                <div class="feature-value">22.3%</div>
                            </div>
                            <div class="feature-item">
                                <div class="feature-name">催化剂活性</div>
                                <div class="feature-bar-container">
                                    <div class="feature-bar" style="width: 65%"></div>
                                </div>
                                <div class="feature-value">15.8%</div>
                            </div>
                            <div class="feature-item">
                                <div class="feature-name">pH值波动范围</div>
                                <div class="feature-bar-container">
                                    <div class="feature-bar" style="width: 55%"></div>
                                </div>
                                <div class="feature-value">12.4%</div>
                            </div>
                            <div class="feature-item">
                                <div class="feature-name">反应时间</div>
                                <div class="feature-bar-container">
                                    <div class="feature-bar" style="width: 45%"></div>
                                </div>
                                <div class="feature-value">10.2%</div>
                            </div>
                            <div class="feature-item">
                                <div class="feature-name">其他因素</div>
                                <div class="feature-bar-container">
                                    <div class="feature-bar" style="width: 35%"></div>
                                </div>
                                <div class="feature-value">10.8%</div>
                            </div>
                        </div>
                        
                        <div class="factor-correlation">
                            <img src="https://via.placeholder.com/800x400?text=参数相关性热力图" alt="参数相关性热力图" style="width: 100%; height: auto; border-radius: var(--radius); margin-top: 20px;">
                        </div>
                    </div>
                    
                    <!-- 参数优化建议 -->
                    <div class="section-title">参数优化建议</div>
                    
                    <div class="content-card">
                        <div class="content-card-title">
                            <i class="fas fa-sliders-h"></i>
                            优化建议
                        </div>
                        
                        <div class="alert alert-info">
                            <div class="alert-icon"><i class="fas fa-info-circle"></i></div>
                            <div>
                                <strong>优化潜力：</strong> 根据当前工况分析，通过参数调整可提高收率约 1.6%，达到 93.4%。
                            </div>
                        </div>
                        
                        <div class="optimization-suggestions">
                            <table class="performance-table">
                                <thead>
                                    <tr>
                                        <th>参数名称</th>
                                        <th>当前值</th>
                                        <th>建议值</th>
                                        <th>调整幅度</th>
                                        <th>预期影响</th>
                                        <th>操作</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    <tr>
                                        <td>反应温度</td>
                                        <td>138.5°C</td>
                                        <td>142.0°C</td>
                                        <td>+3.5°C</td>
                                        <td>收率 +0.8%</td>
                                        <td><button class="btn btn-primary btn-sm">应用</button></td>
                                    </tr>
                                    <tr>
                                        <td>搅拌速度</td>
                                        <td>180 rpm</td>
                                        <td>210 rpm</td>
                                        <td>+30 rpm</td>
                                        <td>收率 +0.4%</td>
                                        <td><button class="btn btn-primary btn-sm">应用</button></td>
                                    </tr>
                                    <tr>
                                        <td>pH值</td>
                                        <td>6.8</td>
                                        <td>7.2</td>
                                        <td>+0.4</td>
                                        <td>收率 +0.3%</td>
                                        <td><button class="btn btn-primary btn-sm">应用</button></td>
                                    </tr>
                                    <tr>
                                        <td>催化剂添加量</td>
                                        <td>2.4%</td>
                                        <td>2.6%</td>
                                        <td>+0.2%</td>
                                        <td>收率 +0.1%</td>
                                        <td><button class="btn btn-primary btn-sm">应用</button></td>
                                    </tr>
                                </tbody>
                            </table>
                        </div>
                        
                        <div class="optimization-actions">
                            <button class="btn btn-primary">
                                <i class="fas fa-magic mr-2"></i> 一键优化
                            </button>
                            <button class="btn btn-secondary">
                                <i class="fas fa-sliders-h mr-2"></i> 自定义调整
                            </button>
                            <button class="btn btn-secondary">
                                <i class="fas fa-history mr-2"></i> 查看历史优化
                            </button>
                        </div>
                    </div>
                    
                    <!-- 模拟场景 -->
                    <div class="section-title">模拟场景</div>
                    
                    <div class="content-card">
                        <div class="content-card-title">
                            <i class="fas fa-vials"></i>
                            参数调整模拟
                        </div>
                        
                        <div class="simulation-description">
                            <p>通过调整不同参数，模拟预测不同工艺条件下的收率表现，帮助工程师找到最优参数组合。</p>
                        </div>
                        
                        <div class="simulation-controls">
                            <div class="form-group">
                                <label class="form-label">反应温度 (°C)</label>
                                <input type="range" min="130" max="150" value="138" class="slider" id="tempSlider">
                                <div class="slider-value">138°C</div>
                            </div>
                            
                            <div class="form-group">
                                <label class="form-label">反应时间 (h)</label>
                                <input type="range" min="20" max="30" value="24" class="slider" id="timeSlider">
                                <div class="slider-value">24h</div>
                            </div>
                            
                            <div class="form-group">
                                <label class="form-label">催化剂用量 (%)</label>
                                <input type="range" min="2.0" max="3.0" step="0.1" value="2.4" class="slider" id="catalystSlider">
                                <div class="slider-value">2.4%</div>
                            </div>
                            
                            <div class="form-group">
                                <label class="form-label">pH值</label>
                                <input type="range" min="6.0" max="8.0" step="0.1" value="6.8" class="slider" id="phSlider">
                                <div class="slider-value">6.8</div>
                            </div>
                            
                            <div class="simulation-actions">
                                <button class="btn btn-primary">
                                    <i class="fas fa-play mr-2"></i> 运行模拟
                                </button>
                                <button class="btn btn-secondary">
                                    <i class="fas fa-save mr-2"></i> 保存方案
                                </button>
                                <button class="btn btn-secondary">
                                    <i class="fas fa-redo mr-2"></i> 重置
                                </button>
                            </div>
                        </div>
                        
                        <div class="simulation-result">
                            <img src="https://via.placeholder.com/800x400?text=模拟结果图表" alt="模拟结果图表" style="width: 100%; height: auto; border-radius: var(--radius); margin-top: 20px;">
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <!-- JavaScript引用 -->
    <script src="scripts/common.js"></script>
    <script src="scripts/main-nav.js"></script>
    <script src="scripts/unified.js"></script>
    <script>
        // 收率预测页面特定脚本
        document.addEventListener('DOMContentLoaded', function() {
            // 初始化滑块控件
            const sliders = document.querySelectorAll('.slider');
            sliders.forEach(slider => {
                const valueDisplay = slider.nextElementSibling;
                slider.addEventListener('input', function() {
                    let unit = '';
                    switch(this.id) {
                        case 'tempSlider': unit = '°C'; break;
                        case 'timeSlider': unit = 'h'; break;
                        case 'catalystSlider': unit = '%'; break;
                        case 'phSlider': unit = ''; break;
                    }
                    valueDisplay.textContent = this.value + unit;
                });
            });
            
            // 模拟收率预测动画效果
            const yieldValue = document.querySelector('.yield-value');
            if (yieldValue) {
                let startValue = 89.5;
                const endValue = 91.8;
                const duration = 2000; // 2秒
                const stepTime = 50; // 每50毫秒更新一次
                const steps = duration / stepTime;
                const stepValue = (endValue - startValue) / steps;
                
                let currentStep = 0;
                const interval = setInterval(() => {
                    currentStep++;
                    startValue += stepValue;
                    yieldValue.textContent = startValue.toFixed(1) + '%';
                    
                    if (currentStep >= steps) {
                        clearInterval(interval);
                        yieldValue.textContent = endValue.toFixed(1) + '%';
                    }
                }, stepTime);
            }
        });
    </script>
    
    <style>
        /* 收率预测页面特有样式 */
        .yield-prediction {
            display: flex;
            flex-wrap: wrap;
            gap: 30px;
            margin: 20px 0;
        }
        
        .yield-gauge {
            background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
            border-radius: 50%;
            width: 200px;
            height: 200px;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            position: relative;
            box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
            border: 8px solid #fff;
        }
        
        .yield-value {
            font-size: 36px;
            font-weight: 700;
            color: var(--primary-dark);
            margin-bottom: 5px;
        }
        
        .yield-label {
            font-size: 14px;
            color: var(--gray);
            margin-bottom: 10px;
        }
        
        .yield-range {
            font-size: 12px;
            color: var(--gray);
            display: flex;
            flex-direction: column;
            align-items: center;
        }
        
        .yield-details {
            flex: 1;
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
            gap: 20px;
        }
        
        .yield-detail-item {
            background-color: #fff;
            border-radius: var(--radius);
            padding: 15px;
            box-shadow: var(--shadow-sm);
            border: 1px solid rgba(0, 0, 0, 0.05);
        }
        
        .detail-label {
            font-size: 13px;
            color: var(--gray);
            margin-bottom: 5px;
        }
        
        .detail-value {
            font-size: 24px;
            font-weight: 600;
            color: var(--primary-dark);
            margin-bottom: 5px;
        }
        
        .detail-trend {
            font-size: 14px;
            font-weight: 500;
            color: var(--gray);
        }
        
        .detail-trend.trend-up {
            color: var(--success);
        }
        
        .detail-trend.trend-down {
            color: var(--danger);
        }
        
        .detail-info {
            color: var(--primary);
            cursor: pointer;
        }
        
        .optimization-actions {
            margin-top: 20px;
            display: flex;
            gap: 10px;
        }
        
        .simulation-controls {
            margin: 20px 0;
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
            gap: 20px;
        }
        
        .slider {
            width: 100%;
            height: 8px;
            background: #e0e0e0;
            border-radius: 4px;
            outline: none;
            -webkit-appearance: none;
            margin: 10px 0;
        }
        
        .slider::-webkit-slider-thumb {
            -webkit-appearance: none;
            width: 20px;
            height: 20px;
            border-radius: 50%;
            background: var(--primary-gradient);
            cursor: pointer;
            box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
        }
        
        .slider-value {
            font-size: 14px;
            font-weight: 500;
            color: var(--primary-dark);
            text-align: center;
        }
        
        .simulation-actions {
            grid-column: 1 / -1;
            display: flex;
            gap: 10px;
            margin-top: 10px;
        }
        
        .btn-sm {
            padding: 4px 8px;
            font-size: 12px;
        }
        
        @media (max-width: 768px) {
            .yield-prediction {
                flex-direction: column;
            }
            
            .yield-gauge {
                margin: 0 auto;
            }
            
            .yield-details {
                grid-template-columns: 1fr 1fr;
            }
            
            .simulation-controls {
                grid-template-columns: 1fr;
            }
        }
    </style>
</body>
</html> 